package com.czz.portal.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.czz.portal.entity.Ad;
import com.czz.portal.mapper.AdMapper;
import com.czz.portal.service.AdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: AdServiceImpl
 * @Author Czz
 * @Date 2020/2/5
 * @Time 17:30
 **/
@Service
public class AdServiceImpl extends ServiceImpl<AdMapper, Ad> implements AdService {

    @Autowired
    AdMapper adMapper;

    @Override
    public List<Ad> getAdList() {
        QueryWrapper<Ad> queryWrapper = new QueryWrapper();
        queryWrapper.eq("ad_status",0);
        queryWrapper.orderByDesc("ad_sort");
        return adMapper.selectList(queryWrapper);
    }
}
